package eneity;

import java.sql.Date;
import java.text.SimpleDateFormat;

public class Message {
    private String date;
    private String username;
    private String message;

    public String getDate() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return simpleDateFormat.format(date);
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
    public String toString() {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        //用户姓名：留言内容。--留言时间
        return this.getUsername()+"："+this.getMessage()+" --"+this.getDate();
    }
}
